import React from 'react';
import { SecondHeaderC } from '../../../../../comps';
//引入组件
import ZcBaseInfo from './zcBaseInfo'; //资产 1-资产
import TzBaseInfo from './TzBaseInfo'; //投资  2-投资

class BaseInfo extends React.Component {
  componentDidMount() {
    this.props.onRef && this.props.onRef(this);
  }
  //此时是获取基本信息中的内容
  getInfo = () => {
    const { activeKey } = this.props;
    if (activeKey == '1') {
      return this.zc.getInfo;
    } else {
      return this.tz.getInfo;
    }
  };
  render() {
    const { activeKey, disableStatus, baseInfo, baseReportChangeBaseInfo, pageType } = this.props;
    return (
      <div>
        <SecondHeaderC title='基础信息'></SecondHeaderC>
        {activeKey == '1' ? (
          <ZcBaseInfo
            disableStatus={disableStatus}
            pageType={pageType}
            baseReportChangeBaseInfo={baseReportChangeBaseInfo} //这个里面可以获取到报表给的是否有预期收益率
            baseInfo={baseInfo}
            // onAssetTypeChange={this.props?.onAssetTypeChange && this.props?.onAssetTypeChange}
            // onGuaranteeWayChange={this.props?.onGuaranteeWayChange && this.props?.onGuaranteeWayChange}
            // changeStartDate={this.props?.changeStartDate && this.props?.changeStartDate}
            // changeEndDate={this.props?.changeEndDate && this.props?.changeEndDate}
            // onIssueScaleChange={this.props?.onIssueScaleChange && this.props?.onIssueScaleChange}
            onBaseInfoChange={this.props?.onBaseInfoChange && this.props?.onBaseInfoChange}
            onRef={(ref) => (this.zc = ref)}
          ></ZcBaseInfo>
        ) : (
          <TzBaseInfo baseInfo={baseInfo} pageType={pageType} disableStatus={disableStatus} onRef={(ref) => (this.tz = ref)}></TzBaseInfo>
        )}
      </div>
    );
  }
}
export default BaseInfo;
